package com.longway.core.toolbox.wdp.api;

import java.util.Map;

import com.jfinal.kit.JsonKit;
import com.jfinal.kit.Ret;
import com.longway.core.toolbox.utils.HttpUtils;

public class WxaTemplateApi {
    private static String url = "https://api.weixin.qq.com/wxa/gettemplatelist?access_token=";

    /**
     * 获取模板信息
     * {
		  "errcode": 0,
		  "errmsg": "ok",
		  "template_list": [
		    {
		      "create_time": 1488965944,
		      "user_version": "VVV",
		      "user_desc": "AAS",
		      "template_id": 0
		    },
		    {
		      "create_time": 1504790906,
		      "user_version": "11",
		      "user_desc": "111111",
		      "template_id": 4
		    }
		  ]
		}
     */
    @SuppressWarnings("unchecked")
	public static Map<String,Object> gettemplatelist(String name,String code,String code_type,String legal_persona_wechat,String legal_persona_name,String component_phone){
    	String componentAccessToken = ComponentAccessTokenApi.getComponentAccessTokenStr();  
    	  String json = HttpUtils.get(url+componentAccessToken);
    	  return JsonKit.parse(json, Map.class);
    }
    
}
